package com.koron.order.cockpitStats.business.bean.query;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @ClassName DefectStatsQuery
 * @description
 * @Author zhouj
 * @Date 2022/5/24 14:54
 */
@Data
public class DefectStatsQuery {

    @ApiModelProperty("父级组织id")
    private String parentOrgId;

    @ApiModelProperty("父级组织名称")
    private String parentOrgName;

    @ApiModelProperty(value = "组织ids", hidden = true)
    private List<String> orgIds;

    @ApiModelProperty("统计月份")
    private Date month;

    @ApiModelProperty("统计年份")
    private Date year;

    @ApiModelProperty(value = "月初日期", hidden = true)
    private Date monthStart;

    @ApiModelProperty(value = "月末日期", hidden = true)
    private Date monthEnd;

    @ApiModelProperty(value = "年初日期", hidden = true)
    private Date yearStart;

    @ApiModelProperty(value = "年末日期", hidden = true)
    private Date yearEnd;

    @ApiModelProperty(value = "统计层级(公司:1 部门:2 单位:3)", hidden = true)
    private String level;

    public Date getMonth() {

        if (month == null) {
            return new Date();
        }

        return month;
    }

    public Date getYear() {
        if (year == null) {
            return new Date();
        }
        return year;
    }
}
